package day13;

import java.io.*;

public class FileCopyDemo {

    public static void main(String[] args) {
        try (
            BufferedReader br=new BufferedReader(new FileReader("src/test/FileDem.java"));
            PrintWriter out=new PrintWriter(new FileWriter("src/test/FileDemashd.java"))){
            while(true){
                String line=br.readLine();
                if(line==null)
                    break;
                out.println(line);
            }
            System.out.println("　文件拷贝成功");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
